﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MyCollection
{
    public partial class FormSetting : Form
    {
        public FormSetting()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.ShowDialog();
            textBox1.Text = folderBrowserDialog1.SelectedPath + "\\";
        }

        private void button4_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.ShowDialog();
            textBox2.Text = folderBrowserDialog1.SelectedPath + "\\";
        }

        private void button5_Click(object sender, EventArgs e)
        {
            this.openFileDialog1.ShowDialog();
            textBox3.Text = openFileDialog1.FileName;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CollectSetting.Default.SaveImagePath = textBox1.Text;
            CollectSetting.Default.SaveCSVPath = textBox2.Text;
            CollectSetting.Default.HtmlTemplet = textBox3.Text;
            CollectSetting.Default.Save();
            CollectSetting.Default.Reload();
            this.Close();
        }

        private void FormSetting_Load(object sender, EventArgs e)
        {
            textBox1.Text = CollectSetting.Default.SaveImagePath;
            textBox2.Text = CollectSetting.Default.SaveCSVPath;
            textBox3.Text = CollectSetting.Default.HtmlTemplet;
        }
    }
}